const mailer = require('nodemailer')
const SMTP_CONFIG = {
    host: 'smtp.163.com',
    port: 25,
    secure: false,
    auth: {
        user: 'huge_pub@163.com',
        pass: '12345abc'
    }
};

const transport = mailer.createTransport(SMTP_CONFIG)

async function sendMail(subject, html){
    let message = {
        form: 'huge@163.com',
        to: 'huge@163.com',
        subject: subject,
        html: subject
    }
    transport.sendMail(message)
        .then()
        .catch(e => {
            console.log(e)
        })
}

module.exports = {
    sendMail
}

sendMail('hahah','lalal')

